package com.D5Power.Editor
{
	import org.aswing.JLabel;
	import org.aswing.JPanel;
	import org.aswing.LayoutManager;
	import org.aswing.border.TitledBorder;
	import org.aswing.ext.Form;

	/**
	 * 当前属性查看器
	 * 
	 */ 
	public class ProViewer extends JPanel
	{

		private var _box:Form;
		private var worldPos:JLabel;
		private var tilePos:JLabel;
		private var scenePos:JLabel;
		public function ProViewer(layout:LayoutManager=null)
		{
			super(layout);
			init();
		}
		
		private function init():void
		{
			_box = new Form();
			
			// 当前点击坐标
			var lable:JLabel = new JLabel('世界坐标：',null,JLabel.LEFT);
			worldPos = new JLabel('0,0',null,JLabel.LEFT);
			worldPos.setPreferredWidth(80);
			
			// 场景地图
			var lable0:JLabel = new JLabel('区块坐标：',null,JLabel.LEFT);
			tilePos = new JLabel('0,0',null,JLabel.LEFT);
			
			// 增加Lua脚本控制
			var lable1:JLabel = new JLabel('屏幕坐标：',null,JLabel.LEFT);
			scenePos = new JLabel('0,0',null,JLabel.LEFT);
			
			
			_box.addRow(lable,worldPos);
			_box.addRow(lable0,tilePos);
			_box.addRow(lable1,scenePos);
			
			_box.setSizeWH(D5Power.SMALLMAPSIZE,200);
			append(_box);
			
			setBorder(new TitledBorder(null,'实时参数',TitledBorder.TOP,TitledBorder.LEFT,4));
		}
		
		public function setWorldPos(x:uint,y:uint):void
		{
			worldPos.setText(x+','+y);
		}
		
		public function setTilePos(x:uint,y:uint):void
		{
			tilePos.setText(x+','+y);
		}
		
		public function setScenePos(x:uint,y:uint):void
		{
			scenePos.setText(x+','+y);
		}
	}
}